/**
 * 全局 OSS Client 工具
 */

// 获取全局 OSS Client
export const getGlobalClient = () => {
  const app = getApp()
  return app.getOSSClient()
}

// 检查 OSS Client 是否可用
export const isClientAvailable = () => {
  const client = getGlobalClient()
  return client !== null
}

// 获取 OSS Client 状态
export const getClientStatus = () => {
  const app = getApp()
  const client = app.getOSSClient()
  
  if (!client) {
    return {
      available: false,
      message: 'OSS Client 未初始化'
    }
  }
  
  return {
    available: true,
    message: 'OSS Client 已就绪',
    client: client
  }
}
